import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        routes: [],
        knowledgeId: "", //知识点id
        activePath: "" ,//保存菜单激活链接
        homePath: "" ,//保存主页地址
        topicId:"", //题目id
        examPaperId: "",//试卷id
        taskId: "",// 任务id
        userLogId: "", //用户日志id
        clazzId: "",//班级Id
    },
    mutations: {
        initRoutes(state, data) {
            state.routes = data;
        },
        initknowledgeId(state, data){
            state.knowledgeId = data;
        },
        initActivePath(state,data){
            // console.log(data);
            state.activePath = data;
        },
        initHomePath(state,data){
            // console.log(data);
            state.homePath = data;
        },
        initTopicId(state,data){
            // console.log(data);
            state.topicId = data;
        },
        initExamPaperId(state,data){
            console.log(data);
            state.examPaperId = data;
        },
        initTaskId(state,data){
            state.taskId = data;
        },
        initUserLogId(state,data){
            state.userLogId = data;
        },
        initClazzId(state,data){
            state.clazzId = data;
        }
    }
})